/**
 * Created by John on 2016/7/18.
 */
var mongo = new Mongo('localhost');
var db = mongo.getDB('BeginningMongoDB');

var indexes = db.getCollection('word_stats').getIndexes();
printjson(indexes);

print();
var result = db.getCollection('word_stats').ensureIndex(
    {first: 1, size: -1},
    {background: true, name: "myIndex"}
);
printjson(result);

print();
indexes = db.getCollection('word_stats').getIndexes();
printjson(indexes);

print();
result = db.getCollection('word_stats').dropIndex('myIndex');
printjson(result);

print();
indexes = db.getCollection('word_stats').getIndexes();
printjson(indexes);